*
* The communication between a #GtkSocket and a #GtkPlug follows the
* [XEmbed Protocol](http://www.freedesktop.org/Standards/xembed-spec).
- * This protocol has also been implemented in other toolkits,
- * e.g. Qt, allowing the same level of
- * integration when embedding a Qt widget
+ * This protocol has also been implemented in other toolkits, e.g. Qt,
+ * allowing the same level of integration when embedding a Qt widget
* in GTK+ or vice versa.
*
* The #GtkPlug and #GtkSocket widgets are only available when GTK+
* is compiled for the X11 platform and %GDK_WINDOWING_X11 is defined.
* They can only be used on a #GdkX11Display. To use #GtkPlug and
- * #GtkSocket, you need to include the `gtk/gtkx.h`
- * header.
+ * #GtkSocket, you need to include the `gtk/gtkx.h` header.
*/
struct _GtkPlugPrivate
const gchar *title;
gchar *wmclass_name, *wmclass_class;
gint attributes_mask;
+ GdkScreen *screen;
gtk_widget_set_realized (widget, TRUE);
+ screen = gtk_widget_get_screen (widget);
+ if (!GDK_IS_X11_SCREEN (screen))
+ g_warning ("GtkPlug only works under X11");
+
title = gtk_window_get_title (window);
_gtk_window_get_wmclass (window, &wmclass_name, &wmclass_class);
gtk_widget_get_allocation (widget, &allocation);
GdkWindow *root_window;
attributes.window_type = GDK_WINDOW_TOPLEVEL;
- root_window = gdk_screen_get_root_window (gtk_widget_get_screen (widget));
+ root_window = gdk_screen_get_root_window (screen);
gdk_error_trap_push ();
if (priv->socket_window)
*
* The communication between a #GtkSocket and a #GtkPlug follows the
* [XEmbed Protocol](http://www.freedesktop.org/Standards/xembed-spec).
- * This protocol has also been implemented in other toolkits,
- * e.g. Qt, allowing the same level of
- * integration when embedding a Qt widget
+ * This protocol has also been implemented in other toolkits, e.g. Qt,
+ * allowing the same level of integration when embedding a Qt widget
* in GTK or vice versa.
*
* The #GtkPlug and #GtkSocket widgets are only available when GTK+
* is compiled for the X11 platform and %GDK_WINDOWING_X11 is defined.
* They can only be used on a #GdkX11Display. To use #GtkPlug and
- * #GtkSocket, you need to include the `gtk/gtkx.h`
- * header.
+ * #GtkSocket, you need to include the `gtk/gtkx.h` header.
*/
/* Forward declararations */
GdkWindowAttr attributes;
XWindowAttributes xattrs;
gint attributes_mask;
+ GdkScreen *screen;
gtk_widget_set_realized (widget, TRUE);
+ screen = gtk_widget_get_screen (widget);
+ if (!GDK_IS_X11_SCREEN (screen))
+ g_warning ("GtkSocket: only works under X11");
+
gtk_widget_get_allocation (widget, &allocation);
attributes.window_type = GDK_WINDOW_CHILD;